home *** CD-ROM | disk | FTP | other *** search
/ The Business Master (3rd Edition) / The Business Master (3rd Edition).iso / files / utilstem / util2 / push-pop.do1 < prev    next >
Encoding:
Text File  |  1986-10-30  |  2.5 KB  |  57 lines

  1.  
  2.           PUSHDIR (and POPDIR)                       John Friend
  3.           Commands                                        No. 23
  4.  
  5.           ______________________________________________________
  6.  
  7.           Purpose:  Provides a way to return automatically to
  8.                     your current directory after running programs
  9.                     that require directory changing.
  10.  
  11.           Format:   PUSHDIR
  12.                     [CD \AltDir\ProgName]
  13.                     POPDIR
  14.  
  15.           Remarks:  While PUSHDIR and POPDIR can be entered
  16.                     directly from the DOS prompt, their primary
  17.                     application is in batch files.  For example,
  18.                     suppose you create a file named 12.BAT that
  19.                     consists of the following four lines:
  20.  
  21.                          PUSHDIR
  22.                          CD\LOTUS
  23.                          123
  24.                          POPDIR
  25.  
  26.                     Suppose also that 12.BAT, PUSHDIR.COM, and
  27.                     POPDIR.COM are either in your root directory
  28.                     or in a subdirectory on the PATH specified in
  29.                     your AUTOEXEC.BAT file.  Assume, finally, 
  30.                     that you are currently in your word processing 
  31.                     subdirectory (\WP), but need some information 
  32.                     from a 1-2-3 spreadsheet.  If you now enter 
  33.  
  34.                          12<CR>
  35.  
  36.                     from the DOS prompt, PUSHDIR stores the \WP
  37.                     (your current directory) on its stack and DOS
  38.                     changes to the \LOTUS subdirectory and runs
  39.                     1-2-3.  When you exit from 1-2-3, you would 
  40.                     normally be left in the \LOTUS subdirectory.  
  41.                     A DOS CD command in 12.BAT after the 123 line 
  42.                     could return you to a specified directory 
  43.                     every time you terminated 1-2-3, of course.  
  44.                     But POPDIR returns you to whatever subdirectory 
  45.                     you were in when you invoked 1-2-3--in this 
  46.                     case, to your \WP subdirectory.  
  47.  
  48.                     PUSHDIR can accommodate up to six levels of
  49.                     directories on its stack, permitting
  50.                     considerable programming flexibility in
  51.                     constructing batch files.
  52.  
  53.                     Notes:
  54.  
  55.                     1.   PUSHDIR and POPDIR require DOS 2.0 or
  56.                          later.
  57.